clear all
program drop _all
set more off
set mem 600m

cd "C:\Users\master\Dropbox\Research\mexican_repatriates2\data\kwan"
use "D:\raw\1910.dta"

keep statefip county occ1950 empstat empstatd classwkrd gq school bpl bpld fbpl mbpl

keep if occ1950<979
keep if empstat==1
drop if empstatd==13
drop if classwkrd==29
drop if school==2

keep if bpld<15000 | bpld==90011 | bpld==90021 | bpld==90022
drop if bpl==200 | fbpl==200 | mbpl==200

replace county = (1000*statefip) + (county/10)

merge m:m occ1950 using "C:\Users\master\Dropbox\Research\mexican_repatriates2\data\kwan\wage_by_occupation.dta", nogenerate

drop if wage==.

collapse (mean) wage10=wage, by(county)

save wage1910.dta, replace 


